Carbon


MapRect

Header: Quickdraw.h Carbon status: Supported

Maps and scales a rectangle within one rectangle to another rectangle.

void MapRect (
    Rect *r, 
    const Rect *srcRect, 
    const Rect *dstRect
);
Parameter descriptions
r

Upon input, a pointer to the rectangle to map; upon completion, the mapped rectangle.

srcRect

The rectangle containing the rectangle to map.

dstRect

The rectangle in which the new rectangle will be mapped.

DISCUSSION

The MapRect function takes a rectangle within one rectangle and maps and scales it to another rectangle. In the r parameter, you specify a rectangle that lies within the rectangle that you specify in the srcRect parameter. By calling the MapPt function to map the upper-left and lower-right corners of the rectangle in the r parameter, MapRect maps and scales it to the rectangle that you specify in the dstRect parameter. The MapRect function returns the newly mapped rectangle in the r parameter.

SPECIAL CONSIDERATIONS

If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)